package com.zb;

import java.math.BigInteger;

public class TenantContextHolder {

    private static final ThreadLocal<BigInteger> tenantId = new ThreadLocal<>();
    private static final ThreadLocal<String> dataSource = new ThreadLocal<>();
    public static void setTenantId(BigInteger tenantId) {
        TenantContextHolder.tenantId.set(tenantId);
    }
    public static BigInteger getTenantId() {
        return tenantId.get();
    }
    public static void clear() {
        tenantId.remove();
        dataSource.remove();
    }
    public static void setDataSource(String dataSource) {
        TenantContextHolder.dataSource.set(dataSource);
    }
    public static String getDataSource() {
        return dataSource.get();
    }
}
